package com.yang.news.dao.mapper;

import com.yang.news.dao.entity.VisitLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;

/**
* @author Billyang
* @description 针对表【t_visit_log】的数据库操作Mapper
* @createDate 2024-11-29 10:53:44
* @Entity com.yang.news.dao.entity.VisitLog
*/
@Mapper
public interface VisitLogMapper extends BaseMapper<VisitLog> {
    @Select("SELECT COUNT(DISTINCT ip) FROM t_visit_log WHERE create_time BETWEEN #{startTime} AND #{endTime}")
    int queryUvByStartTimeAndEndTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);

    @Select("SELECT COUNT(DISTINCT ip) FROM t_visit_log")
    int queryUv();
}




